<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for loginCheckController.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						<h1>Source for file loginCheckController.php</h1>
<p>Documentation is available at <a href="../default/_ays_application_controller_loginCheckController_php.html">loginCheckController.php</a></p>
<div class="src-code">
<pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'logged'</span><span class="src-sym">]</span><span class="src-sym">) </span><span class="src-key">AND </span><span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'logged'</span><span class="src-sym">] </span>== <span class="src-id">TRUE</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a3"></a>    <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Location: index.php?page=adminIndex&amp;sessid='</span>.<span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'idSession'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a4"></a><span class="src-sym">}</span><span class="src-key">elseif</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-str">'submit'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">{</span></li>
<li><a name="a5"></a>    <span class="src-inc">require_once </span><span class="src-id">MODEL_DIR</span>.<span class="src-str">'/UserModel.php'</span><span class="src-sym">;</span></li>
<li><a name="a6"></a>&nbsp;</li>
<li><a name="a7"></a>    <span class="src-var">$sName </span>= <span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-str">'name'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a8"></a>    <span class="src-var">$sPass </span>= <span class="src-var">$_POST</span><span class="src-sym">[</span><span class="src-str">'pass'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a9"></a>&nbsp;</li>
<li><a name="a10"></a>    try<span class="src-sym">{</span></li>
<li><a name="a11"></a>        <span class="src-id"><a href="../default/UserModel.html">UserModel</a></span><span class="src-sym">::</span><a href="../default/UserModel.html#methodcheckName">checkName</a><span class="src-sym">(</span><span class="src-var">$sName</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a12"></a>        <span class="src-id"><a href="../default/UserModel.html">UserModel</a></span><span class="src-sym">::</span><a href="../default/UserModel.html#methodcheckPass">checkPass</a><span class="src-sym">(</span><span class="src-var">$sPass</span><span class="src-sym">, </span><span class="src-var">$sName</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a13"></a>&nbsp;</li>
<li><a name="a14"></a>        <span class="src-var">$asmUserInfos </span>= <span class="src-id"><a href="../default/UserModel.html">UserModel</a></span><span class="src-sym">::</span><a href="../default/UserModel.html#methodgetInfosFromName">getInfosFromName</a><span class="src-sym">(</span><span class="src-var">$sName</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a15"></a>&nbsp;</li>
<li><a name="a16"></a>        <span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'logged'</span><span class="src-sym">] </span>= <span class="src-id">TRUE</span><span class="src-sym">;</span></li>
<li><a name="a17"></a>        <span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'idSession'</span><span class="src-sym">] </span>= <a href="http://www.php.net/session_id">session_id</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a18"></a>        <span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'idUser'</span><span class="src-sym">] </span>= <span class="src-var">$asmUserInfos</span><span class="src-sym">[</span><span class="src-str">'idUser'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a19"></a>        <span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'nameUser'</span><span class="src-sym">] </span>= <span class="src-var">$sName</span><span class="src-sym">;</span></li>
<li><a name="a20"></a>        <span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'emailUser'</span><span class="src-sym">] </span>= <span class="src-var">$asmUserInfos</span><span class="src-sym">[</span><span class="src-str">'emailUser'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a21"></a>        <span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'rankUser'</span><span class="src-sym">] </span>= <span class="src-var">$asmUserInfos</span><span class="src-sym">[</span><span class="src-str">'rankUser'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a22"></a>&nbsp;</li>
<li><a name="a23"></a>        <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Location: index.php?page=adminIndex&amp;sessid='</span>.<span class="src-var">$_SESSION</span><span class="src-sym">[</span><span class="src-str">'idSession'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a24"></a>    <span class="src-sym">}</span>catch<span class="src-sym">(</span><span class="src-id"><a href="../default/InvalidNameException.html">InvalidNameException</a> </span><span class="src-var">$oException</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a25"></a>        <span class="src-var">$oException</span><span class="src-sym">-&gt;</span><span class="src-id">addLog</span><span class="src-sym">(</span><span class="src-str">'InvalidName'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a26"></a>        <span class="src-var">$sMessage </span>= <span class="src-var">$oException</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a27"></a>        <span class="src-inc">include_once </span><span class="src-id">VIEW_DIR</span>.<span class="src-str">'/errors.php'</span><span class="src-sym">;</span></li>
<li><a name="a28"></a>    <span class="src-sym">}</span>catch<span class="src-sym">(</span><span class="src-id"><a href="../default/InvalidPassException.html">InvalidPassException</a> </span><span class="src-var">$oException</span><span class="src-sym">)</span><span class="src-sym">{</span></li>
<li><a name="a29"></a>        <span class="src-var">$oException</span><span class="src-sym">-&gt;</span><span class="src-id">addLog</span><span class="src-sym">(</span><span class="src-str">'InvalidPass'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a30"></a>        <span class="src-var">$sMessage </span>= <span class="src-var">$oException</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a31"></a>        <span class="src-inc">include_once </span><span class="src-id">VIEW_DIR</span>.<span class="src-str">'/errors.php'</span><span class="src-sym">;</span></li>
<li><a name="a32"></a>    <span class="src-sym">}</span></li>
<li><a name="a33"></a><span class="src-sym">}</span></li>
</ol></pre>
</div>
	<p class="notes" id="credit">
		Documentation generated on Sun, 30 Mar 2008 00:13:52 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</body>
</html>